package utils;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

import edu.uci.ics.jung.algorithms.util.KMeansClusterer;

public class KMeans {
	public static void kmeans() {
		// FIXME - add sources from method arguments
		/*
        KMeansClusterer clusterer = new KMeansClusterer();
        Map au_1_m = new HashMap<String, double[]>();

        for(int i = 0; i < aus.get(0).getIncluded().size(); i++ ) {
        	au_1_m.put("AU_1_" + i, aus.get(0).getIncluded().get(i));
        }
        
        for(int i = 0; i < aus.get(0).getExcluded().size(); i++ ) {
        	au_1_m.put("N_" + i, aus.get(0).getExcluded().get(i));
        }
        
        Collection au_1_c = clusterer.cluster(au_1_m, 2);
        
        Object[] au_1_a = au_1_c.toArray();
        Map au_1_c1_m = (Map) au_1_a[0];
        Map au_1_c2_m = (Map) au_1_a[1];

        Object[] au_1_c1_keys_a = au_1_c1_m.keySet().toArray(); 
        Object[] au_1_c2_keys_a = au_1_c2_m.keySet().toArray(); 

        for(int i = 0; i < au_1_c1_keys_a.length; i++) System.out.println("C1: " + (String) au_1_c1_keys_a[i] + " -> " + printVector((double[])au_1_c1_m.get(au_1_c1_keys_a[i])));
        System.out.println();
        for(int i = 0; i < au_1_c2_keys_a.length; i++) System.out.println("C2: " + (String) au_1_c2_keys_a[i] + " -> " + printVector((double[])au_1_c2_m.get(au_1_c2_keys_a[i])));
		*/
	}
}
